<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>Node Express Server</h1>
    <script>
      // iframe
      function receiveMessageFromIndex(event) {
        console.log("iframe页面监听: ", event.data);
        if (event.origin === "http://localhost:8801") {
          event.source.window.postMessage("hahaha,传给父", "*");
        }
      }

      window.addEventListener("message", receiveMessageFromIndex);
    </script>
  </body>
</html>
